package com.leyou.auth.config;

import com.leyou.auth.task.PrivileageAuthTokenHolder;
import feign.RequestInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author xiuer
 * @description 将自定义拦截器添加到spring容器中
 * @create 2019/7/11 15:26
 */
@Configuration
public class FeignConfig {
    @Autowired
    private JwtProperties properties;
    @Autowired
    private PrivileageAuthTokenHolder tokenHolder;

    @Bean
    public RequestInterceptor requestInterceptor() {
        return new PrivilegeTokenConfig(properties, tokenHolder);
    }
}
